//设备新增
import commonRequest from '/@/api/common/common';
import { i18n } from '/@/locales/i18n';
const $t = i18n.global.t;

export default function (data: any) {
	const array = [
		{
			type: 'slot',
			slotName: 'tint1',
			label: $t('l4vGAiubhrTaPWe5vDq1o'),
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},
		{
			type: 'input',
			label: $t('9xM6FvTR_8nWq19wjfgx'),
			key: 'v_WorkType',
			value: data.v_WorkType || '',
			rules: [{ required: true, message: $t('dRMoJAvogb9PLbSoUwe41'), trigger: ['blur', 'change'] }],
			disabledStyle: data.disable,
		},

		{
			type: 'select',
			label: $t('ebd7Jl2fPx6WeiyWryLYl'),
			key: 'n_Accident_TypeId',
			value: data.v_Accient_TypeName || '',
			placeHolder: $t('ehhbmuhU8y6pDtkJzLPh'),
			disabledStyle: data.disable,
			selectOption: {
				type: 'remote',
				loading: false,
				requestMethod: commonRequest.getSysDictData,
				searchKey: 'value',
				value: 'id',
				label: 'value',
				otherParams: {
					typecode: 'hazard_accident',
				},
			},
			rules: [{ required: true, message: $t('key_0'), trigger: ['blur', 'change'] }],
		},

		// {
		// 	type: 'input',
		// 	label: $t('ofqKTloNBlhMn0pt8yCkH'),
		// 	disabledStyle: data.disable,
		// 	key: 'v_Inspection_Points',
		// 	value: data.v_Inspection_Points || '',
		// 	rules: [{ required: true, message: $t('qalUgh8IffpZdEjrBakWy'), trigger: ['blur', 'change'] }],
		// },
		// {
		// 	type: 'input',
		// 	label: $t('xCeeB3WeM4ZkHhTh5btqG'),
		// 	key: 'v_Control_Measures',
		// 	value: data.v_Control_Measures || '',
		// 	rules: [{ required: true, message: $t('7LkKYu4Cp4ATlKfAm3kZ'), trigger: ['blur', 'change'] }],
		// 	disabledStyle: data.disable,
		// },
		{
			type: 'slot',
			slotName: 'org',
			label: $t('34HDoV6Hki2Cjq7aCki1Z'),
			rules: [{ required: true, message: $t('jcAyqYrWKamW8uK_7Kbhp'), trigger: ['blur', 'change'] }],
			disabledStyle: data.disable,
		},
		{
			type: 'slot',
			slotName: 'n_EmpId',
			label: $t('y7I9J0Du746oyZTnse2kM'),
			rules: [{ required: true, message: $t('jcAyqYrWKamW8uK_7Kbhp'), trigger: ['blur', 'change'] }],
			disabledStyle: data.disable,
		},
		{
			type: 'radio',
			label: $t('sfwbsExMM3lGjDuN5zHf'),
			key: 'n_isValid',
			value: data.n_isValid || 1,
			options: [
				{
					value: 1,
					label: $t('iPfonvtxVLm7knSyCsLBo'),
				},
				{
					value: 2,
					label: $t('tzm8JwYsKnqKoNhheJlJx'),
				},
			],
			disabledStyle: data.disable,
		},
		//是否启用
		{
			type: 'input',
			label: $t('9RLaVEiJf1Z1Qv15o6Kll'),
			key: 'v_Remake',
			value: data.v_Remake || '',
			disabledStyle: data.disable,
		},
		{
			type: 'slot',
			slotName: 'tint1',
			label: $t('odQpuOypYmCIbyEj44TpZ'),
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},
		{
			type: 'slot',
			slotName: 'change',
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},
		// v_Shielding: '',
		// 					v_Advice_Shielding: '',
		{
			type: 'slot',
			slotName: 'levels',
			key: 'levels',
			value: data.levels
				? data.levels
				: [
						{
							v_WorkExplain: '',
							
							v_Control_Measures: '',
							v_Control_Level: '',
							f_Risk_Assessment_L: 1,
							f_Risk_Assessment_E: 1,
							f_Risk_Assessment_C: 1,
							f_Risk_Assessment_D: '',
							danger_level: '',
							v_Remake: '',
							n_Id: 0,
						},
				  ],
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},
	];
	return array;
}
